package com.hyx.bookManager;

import com.hyx.bookManager.mapper.MonitorMapper;
import com.hyx.bookManager.server.ImageServer;
import com.hyx.bookManager.utils.EmailUtil;
import com.hyx.bookManager.utils.TokenUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class BookmanagerApplication implements CommandLineRunner {

    @Autowired
    MonitorMapper monitorMapper;

    @Autowired
    EmailUtil emailUtil;

    public static void main(String[] args) {
        SpringApplication.run(BookmanagerApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        new Thread(new ImageServer(monitorMapper,emailUtil)).start();
    }
}
